#this script now embedded in hnol_rss.sh, no longer needs to run separately
#identify jpgsize is x > y or reverse,if xsize>ysize,resize to 480x320,mv to $2(hori/)
#				                else,resize to 320x480,mv to $3(vert/)
#identify -ping $1 | sed -e "s/.*JPEG //g" | sed -e "s/x.*//g"

xsize=`identify -ping $1 | sed -e "s/.*JPEG //g" | sed -e "s/x.*//g"`
ysize=`identify -ping $1 | sed -e "s/.*JPEG [0-9]*x//g" | sed -e "s/\ [0-9]*x.*//g"`

if [ $xsize -ge $ysize ] ; then
    if [ $xsize -ge 500 ] ; then
	mogrify -resize 480x320 $1
    fi
    mv $1 $2
else 	
    if [ $ysize -ge 500 ] ; then
	mogrify -resize 320x480 $1
    fi
    mv $1 $3
fi

